﻿using HZU.ZP.Data.Interfaces.Resume;
using HZU.ZP.Domain.IService.Resume;
using HZU.ZP.Domain.Model.Resume;
using HZU.ZP.Domain.ServiceImpl.Mappers.Resume;
using System;
using System.Collections.Generic;
using System.Text;

namespace HZU.ZP.Domain.ServiceImpl.PCSvc.Resume
{
    public class MasterSkillService:IMasterSkillService
    {
        private MasterSkillMapper _mapper = new MasterSkillMapper();
        private IMasterSkillDao _sqlData;
        public MasterSkillService(IMasterSkillDao sqlData)
        {
            _sqlData = sqlData;
        }

        public bool AddMasterSkill(MasterSkill masterSkill)
        {
            var masterSkillDao = _mapper.MapToDao(masterSkill);
            _sqlData.AddMasterSkill(masterSkillDao);
            return true;
        }

        public bool DeleteMasterSkill(int id)
        {
            _sqlData.DeleteMasterSkill(id);
            return true;
        }

        public IList<MasterSkill> GetMasterSkillList(int applicanId)
        {
            return _mapper.MapToDomainList(_sqlData.GetMasterSkillList(applicanId));
        }

        public bool UpdateMasterSkill(MasterSkill masterSkill)
        {
            var masterSkillDao = _mapper.MapToDao(masterSkill);
            _sqlData.UpdateMasterSkill(masterSkillDao);
            return true;
        }
    }
}
